<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>promise串联多个操作任务</title>
</head>
<body>
<script>
    let p = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve('ok')
        }, 1000)
    })


    // 其实就是套娃,无限套娃
    p.then(value => {
        console.log(value)
        return new Promise((resolve, reject) => {
            // resolve('success')
            reject('error')
        })
    }).then((value) => {
            console.log(value)
        }
        , (reason) => {
            console.log(reason)
            return new Promise((resolve, reject) => {
                reject('111')
            })
        }).then(value => {
        console.log(value)
    }, reason => {
        console.log(reason)
    })
</script>
</body>
</html>